package com.infonova.product.jtf.blame.svn;

import java.io.File;

import com.infonova.product.jtf.blame.ClassFinder;

public class Change {
    
    public enum ChangeType {
        ADD,
        MODIFY,
        DELETE,
    }

    private Commit commit;
    private String partFilePath;
    private Change.ChangeType type;


    public Commit getCommit() {
        return commit;
    }

    public void setCommit(Commit commit) {
        this.commit = commit;
    }

    public File findFile() {
        return new File(ClassFinder.getInstance().findFile(partFilePath));
    }

    public String getPartFilePath() {
        return partFilePath;
    }

    public void setPartFilePath(String partFilePath) {
        this.partFilePath = partFilePath;
    }

    public Change.ChangeType getType() {
        return type;
    }

    public void setType(Change.ChangeType type) {
        this.type = type;
    }

    public void setType(char c) {
        setType(c == 'M' ? ChangeType.MODIFY : c == 'A' ? ChangeType.MODIFY : ChangeType.DELETE);
    }

}